// FrogBaseDialog.h : Declaration of the CFrogBaseDialog

#pragma once

#include "resource.h"       // main symbols
#include <atlhost.h>
#include <list>
#include "FrogBaseDialog.h"
#include "FrogProgressDialog.h"
#include "IReportProgess.h"

using namespace std;

// CFrogBaseDialog
template <class T>
class CFrogProgressReportDialog: 
	public CFrogBaseDialog<T>,
	public IReportProgess
{
public:

	list<wstring> m_FilesList;
	wstring m_FolderPath;
	FRRESPONSE m_LastResult;

	CFrogProgressReportDialog(HICON hIcon):
	CFrogBaseDialog(hIcon),
		m_FrogProgressDialog(hIcon, this),
		m_FolderPath(L"")
	{
	}

	void RunAsyncCommandWithProgressBar(bool isMarquee = true)
	{
		this->ShowWindow(SW_HIDE);
		m_FrogProgressDialog.m_MarqueeProgressBar = isMarquee;
		m_FrogProgressDialog.DoModal(m_hWnd);
	}

	virtual void ReportProgress(int progress, bool closeProgressWindow)
	{
		// Sets the Marquee Style
		if (closeProgressWindow)
		{
			m_FrogProgressDialog.ShowWindow(SW_HIDE);
		}
		else if (!m_FrogProgressDialog.IsWindowVisible())
		{

			m_FrogProgressDialog.ShowWindow(SW_SHOW);
		}

		m_FrogProgressDialog.SetProgress(progress);
	}
protected:
	CFrogProgressDialog m_FrogProgressDialog;	
};
